<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="/css/main.css">
<div class='teacher-container' id='app'>
    <div class="form">
        <div class="form-inputs">

            <select class="form-control">
                <option>本月</option>
                <option>上月</option>
                <option>近七天</option>
                <option>近30天</option>
            </select>

            <input type="date" name="" placeholder="年-月-日" class="form-control"><span class="time-center">至</span>
            <input type="date" name="" placeholder="年-月-日" class="form-control">

            <input type="text" name="" placeholder="折扣幅度" class="form-control">
            <br/>

            <select class="pro form-control" v-model="pid" @change="prochange()" class="">
            <option value="0" selected>全部省</option>
            <option :value="v.id" v-for="v in pro">${v.name}</option>
            </select>
            <select class="city form-control" v-model="cid" @change="citychange()" class="form-control">
            <option value="0">全部市</option>
            <option :value="v.id" v-for="v in city">${v.name}</option>
            </select>
            <select class="county form-control" v-model="ccid" class="form-control">
                <option value="0">全部县</option>
                <option :value="v.id" v-for="v in county">${v.name}</option>
            </select>
            <br/>

            <select class="form-control">
                <option>学段</option>
                <option>小学</option>
                <option>初中</option>
                <option>高中</option>
                <option>家长</option>
            </select>
            <input type="text" name="" placeholder="学校" class="form-control">
            <select class="form-control">
                <option>年级</option>
                <option>一年级</option>
                <option>二年级</option>
                <option>三年级</option>
                <option>四年级</option>
                <option>五年级</option>
                <option>六年级</option>
                <option>七年级</option>
                <option>八年级</option>
                <option>九年级</option>
                <option>高一</option>
                <option>高二</option>
                <option>高三</option>
            </select>
            <input type="number" name="" placeholder="班级, 例：1" min="1" class="form-control">
        </div>

        <input id='btn-search' type="button" name="" value='查询' class='btn btn-primary'>

    </div>

    <div class="content">
        <table class="table table-bordered">
            <thead>
            <tr>
                <th></th>
                <th>付费会员数</th>
                <th>付费会员覆盖县/区数</th>
                <th>会员费金额</th>
                <th>付费会员点播次数</th>
                <th>新增用户数</th>
                <th>累计用户总数</th>
                <th>用户覆盖县区数</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>一级用户</td>
                <td>sdfsd</td>
                <td>sdfsdds</td>
                <td>sdfsdfds</td>
                <td>sdfsf</td>
                <td>sdfdsfsd</td>
                <td>sdfsf</td>
                <td>sdfsf</td>
                <td><a href="proxy-frame-level.html">查看详情</a></td>
            </tr>
            <tr>
                <td>二级用户</td>
                <td>sdfsd</td>
                <td>sdfsdds</td>
                <td>sdfsdfds</td>
                <td>sdfsf</td>
                <td>sdfdsfsd</td>
                <td>sdfsf</td>
                <td>sdfsf</td>
                <td><a href="proxy-frame-level.html">查看详情</a></td>
            </tr>
            <tr>
                <td>三级用户</td>
                <td>sdfsd</td>
                <td>sdfsdds</td>
                <td>sdfsdfds</td>
                <td>sdfsf</td>
                <td>sdfdsfsd</td>
                <td>sdfsf</td>
                <td>sdfsf</td>
                <td><a href="proxy-frame-level.html">查看详情</a></td>
            </tr>
            </tr>
            <tr>
                <td>总计</td>
                <td>sdfsd</td>
                <td>sdfsdds</td>
                <td>sdfsdfds</td>
                <td>sdfsf</td>
                <td>sdfdsfsd</td>
                <td>sdfdsfsd</td>
                <td>sdfsf</td>
                <td></td>
            </tr>
            </tbody>
            <tfoot>
            <tr>
                <td colspan="9">
                    <nav aria-label="Page navigation">
                        <ul class="pagination">
                            <li>
                                <a href="#" aria-label="Previous">
                                    <span aria-hidden="true">&laquo;</span>
                                </a>
                            </li>
                            <li><a href="#">1</a></li>
                            <li><a href="#">2</a></li>
                            <li><a href="#">3</a></li>
                            <li><a href="#">4</a></li>
                            <li><a href="#">5</a></li>
                            <li>
                                <a href="#" aria-label="Next">
                                    <span aria-hidden="true">&raquo;</span>
                                </a>
                            </li>
                        </ul>
                    </nav>
                </td>
            </tr>
            </tfoot>
        </table>
    </div>
</div>

<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://unpkg.com/vue/dist/vue.js"></script>

<script type="text/javascript">
    var main_host = 'http://rapapi.org/mockjsdata/13896/wechat/v1';

    var app = new Vue({
        delimiters: ['${', '}'],
        el: '#app',
        data: {
            pid: 0,
            pro: null,
            cid: 0,
            city: null,
            ccid: 0,
            county: null
        },
        created: function(){
            this.getArea(function(res){
                this.pro = res;
                this.pid = 0;
            }.bind(this));
        },
        methods:{
            prochange:function(){
                this.getArea(function(res){
                    this.city = res;
                    this.cid = 0;
                    this.citychange();
                }.bind(this),this.pid);
            },
            citychange:function(){
                this.getArea(function(res){
                    this.county = res;
                    this.ccid = 0;
                }.bind(this),this.cid);
            },
            getArea: function(cb,id){
                $.ajax({
                    url: main_host + '/vip/area',
                    data: {
                        id: id
                    },
                    success: function(res){
                        cb && cb(res.data);
                    },
                    fail: function(err){
                        console.log(err);
                    }
                });
            }
        }
    })


</script>
